import unittest

from com.wzh.mile.unit_test.toumile.test_auth_name import TestAuthName, TestSetPaymentPassword
from com.wzh.mile.unit_test.toumile.test_charge import TestCharge
from com.wzh.mile.unit_test.toumile.test_charge_money import TestChargeMoney
from com.wzh.mile.unit_test.toumile.test_crash_card import TestCrashCard
from com.wzh.mile.unit_test.toumile.test_investment import TestInvestment
from com.wzh.mile.unit_test.toumile.test_login import TestLogin
from com.wzh.mile.unit_test.toumile.test_register import TestRegister
from com.wzh.mile.unit_test.toumile.test_withdrawals_money import TestWithdrawalsMoney


def suite_register():
    suite_register = unittest.TestSuite()
    suite_register.addTest(TestRegister('test_validate_and_register'))
    return suite_register


# 登录
def suite_login_from_main():
    suit_login = unittest.TestSuite()
    suit_login.addTest(TestLogin('test_close_red_pac'))
    suit_login.addTest(TestLogin('test_click_menu_my'))
    suit_login.addTest(TestLogin('test_login'))
    return suit_login


# 登录成功后充值
def suite_login_and_charge():
    suit_charge = unittest.TestSuite()
    suit_charge.addTest(TestLogin('test_close_red_pac'))
    suit_charge.addTest(TestLogin('test_click_menu_my'))
    suit_charge.addTest(TestLogin('test_login'))
    suit_charge.addTest(TestCharge('test_my_to_charge'))
    suit_charge.addTest(TestCharge('test_charge_process'))
    return suit_charge


# 登录成功后实名认证
def suite_login_and_auth_name():
    suit_authname = unittest.TestSuite()
    suit_authname.addTest(TestLogin('test_close_red_pac'))
    suit_authname.addTest(TestLogin('test_click_menu_my'))
    suit_authname.addTest(TestLogin('test_login'))
    suit_authname.addTest(TestLogin('test_click_menu_my'))
    suit_authname.addTest(TestAuthName('test_my_account'))
    suit_authname.addTest(TestAuthName('test_auth_name'))
    return suit_authname


# 设置支付密码
def suite_set_payment_password():
    suite_set_payment = unittest.TestSuite()
    suite_set_payment.addTest(TestSetPaymentPassword('test_set_payment_password'))
    return suite_set_payment


# 实名认证 然后设置支付密码
def suite_login_and_auth_name_and_set_payment_password():
    suite_collect = unittest.TestSuite(
        (suite_login_and_auth_name(), suite_set_payment_password(), suite_bind_bank_card(), suite_login_and_charge2()))
    # suite_collect = unittest.TestSuite((suite_login_and_auth_name(), suite_set_payment_password()))
    return suite_collect


# 登录然后绑定银行卡
def suite_bind_bank_card():
    suite_bank_card = unittest.TestSuite((suite_login_from_main()))
    suite_bank_card.addTest(TestAuthName('test_my_account'))
    suite_bank_card.addTest(TestCrashCard('test_bank_card'))
    suite_bank_card.addTest(TestCrashCard('test_bind_bank_card'))
    return suite_bank_card


# 登录之后充值
def suite_login_and_charge2():
    suite_charge_money = unittest.TestSuite((suite_login_from_main()))
    suite_charge_money.addTest(TestLogin('test_click_menu_my'))
    suite_charge_money.addTest(TestChargeMoney('test_click_change_money'))
    suite_charge_money.addTest(TestChargeMoney('test_rechange_information'))
    return suite_charge_money


def suite_login_and_auth_name_and_set_payment_password_and_bind_bank_card_charge_money():
    suite_collect = unittest.TestSuite(('suite_login_and_auth_name_and_set_payment_password()'),
                                       ('suite_bind_bank_card()'), ('suite_login_and_charge2'))
    # suite_login_and_auth_name_and_set_payment_password_and_bind_bank_card_charge_money = unittest.TestSuite((suite_login_from_main()))
    # suite_login_and_auth_name_and_set_payment_password_and_bind_bank_card_charge_money.addTest(T)
    return suite_collect


def suite_all():
    suite_login = unittest.TestSuite(suite_login_from_main())
    # suite_login.addTest(TestLogin('test_close_red_pac'))#关闭红包
    # suite_login.addTest(TestLogin('test_click_menu_my'))#点击我的
    # suite_login.addTest(TestLogin('test_login'))#登录
    suite_login.addTest(TestLogin('test_click_menu_my'))  # 点击我的
    suite_login.addTest(TestAuthName('test_my_account'))  # 点击我的账户
    suite_login.addTest(TestAuthName('test_auth_name'))  # 实名认证
    suite_login.addTest(TestSetPaymentPassword('test_set_payment_password'))  # 设置支付密码
    suite_login.addTest(TestLogin('test_click_menu_my'))  # 点击我的
    suite_login.addTest(TestAuthName('test_my_account'))  # 点击我的账户
    suite_login.addTest(TestCrashCard('test_bank_card'))  # 点击银行卡
    suite_login.addTest(TestCrashCard('test_bind_bank_card'))  # 绑定银行卡
    suite_login.addTest(TestLogin('test_click_menu_my'))  # 点击我的
    suite_login.addTest(TestChargeMoney('test_click_change_money'))
    suite_login.addTest(TestChargeMoney('test_rechange_information'))
    return suite_login


def suite_login_and_withdrawals_money():
    suite_login_with_drawals = unittest.TestSuite(suite_login_from_main())
    suite_login_with_drawals.addTest(TestLogin('test_click_menu_my'))  # 点击我的
    suite_login_with_drawals.addTest(TestWithdrawalsMoney('btn_click_withdrawals_money'))
    suite_login_with_drawals.addTest(TestWithdrawalsMoney('withdrawals_information'))
    return suite_login_with_drawals


def suite_invest_for_many_times():
    suite_invest_many_times = unittest.TestSuite(suite_login_from_main())
    suite_invest_many_times.addTest(TestInvestment('test_invest_for_many_times'))
    return suite_invest_many_times
